<?php

/***  DOCUMENTATION LAYER

Last Update: May 2007
	
DESCRIPTION
	test of klenwell GmailMailer extension of PHPMailer
	
NOTES
	
***/

// Timer
$_tx0 = microtime();

// HEADER
echo "<h1 style='margin:8px 0 0;'>Klenwell Sandbox</h1>";
echo "<h4 style='margin:0 0 16px;'>Gmailer Test</h4>";	// put script name here

// *** PROCEDURAL
if ( 1 ) 
{
	echo "<h4 style='margin:0; color:blue;'>Testing in Progess</h4>";
	
	// settings
	$_PATH['gmailer'] = 'gmailer.class.php';
	
	// run
	require_once($_PATH['gmailer']);
	$Mailer = new GmailMailer($debug=1);
	$Mailer->Username = '';
	$Mailer->Password = '';
	$Mailer->FromName = 'Your Name';
	$Mailer->AddAddress('recipient@gmail.com', 'Recipient Name');
	$Mailer->Subject = 'testing GmailMailer';
	$Mailer->Body = "This is a test of GmailMailer, an extension of PHPMailer for use with Gmail accounts.";
	
	if ( !$Mailer->send_email() ) 
	{
		trigger_error('drats! It failed', E_USER_WARNING);
	}
	else
	{
		$Mailer->print_d('Message successfully sent!');
		$Mailer->print_d("<pre><b>Subject:{$Mailer->Subject}</b>\n{$Mailer->Body}</pre>");
	}	
}


// Footer
$_txn = microtime();
$stx = number_format(((substr($_txn,0,9)) + (substr($_txn,-10)) - (substr($_tx0,0,9)) - (substr($_tx0,-10))),4); 
$footer = <<<HTML
<h4 style="margin:0; position:absolute; top:6px; right:6px; font-family:monospace; color:#36f; padding:4px; border:1px solid #36f; font-weight:normal; background:#f3f6ff;">
script completed in $stx s
</h4>
HTML;
echo $footer;

?>
